call plug#begin('~/.config/nvim/plugged')
  Plug 'farmergreg/vim-lastplace'
  Plug 'neoclide/coc.nvim', {'branch': 'release'}
  Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install', 'for' :['markdown', 'vim-plug'] }
  " Include Phpactor
  Plug 'phpactor/phpactor' ,  {'do': 'composer install', 'for': 'php'}
	Plug 'roxma/nvim-yarp'

  Plug 'fatih/vim-go', { 'do': 'GoUpdateBinaries' }

  Plug 'davidhalter/jedi-vim'
	Plug 'vim-airline/vim-airline'
	Plug 'vim-airline/vim-airline-themes'
	Plug 'mhinz/vim-startify'
	Plug 'yggdroot/indentline'
  Plug 'morhetz/gruvbox'
  Plug 'mattn/emmet-vim'

  Plug 'pangloss/vim-javascript'
  Plug 'mxw/vim-jsx'

  " ES2015 code snippets (Optional)
  Plug 'epilande/vim-es2015-snippets'

  " React code snippets
  Plug 'epilande/vim-react-snippets'

  Plug 'chemzqm/wxapp.vim'
  Plug 'scrooloose/nerdtree'
  Plug 'easymotion/vim-easymotion'

  Plug 'godlygeek/tabular'
  Plug 'plasticboy/vim-markdown'

  Plug 'chemzqm/wxapp.vim'

  Plug 'airblade/vim-gitgutter'
  Plug 'tpope/vim-fugitive'
  Plug 'junegunn/gv.vim'
call plug#end()

set completeopt=noinsert,menuone,noselect
let g:indentLine_concealcursor = ''

set hidden
set nobackup
set nowritebackup
set cmdheight=2
set updatetime=300
set shortmess+=c
set signcolumn=yes

set rnu
set nu
set sw=2
set ts=2
set expandtab
set fileencoding=utf-8
set fileencodings=utf-8,gb2312,gbk,cp936
set cursorline
set nocursorcolumn
set mouse=a
set showtabline=1
set scrolloff=5
set wildmenu
set ignorecase
set smartcase
set guicursor=n-v-c:block,i-ci-ve:ver50

set conceallevel=0
set columns

colorscheme gruvbox
syntax on
 
let mapleader=" "
" let g:mkdp_auto_start = 1

map <F8> <Plug>MarkdownPreviewToggle
let g:mkdp_auto_close=1
" let g:mkdp_browser = 'google-chrome-stable'

" airline 配置
let g:airline_theme='gruvbox'
" let g:airline_theme="luna" 

" 配置vim-airline前准备
" 和以前其他插件不同的是在安装vim-airline前要安装相应打过powerline补丁的字体，不然在airline状态栏上无法正常显示图标和三角形箭头符号。下载安装字体:
" 在 https://github.com/ryanoasis/nerd-fonts 的 patched-fonts 中下载你喜欢的的字体。
" 例如我下载了：patched-fonts/Hermit/Medium/complete/Hurmit Medium Nerd Font Complete Mono Windows Compatible.otf
"
" 这个是安装字体后 必须设置此项" 
" let g:airline_powerline_fonts = 1   
 
"打开tabline功能,方便查看Buffer和切换，这个功能比较不错"
"我还省去了minibufexpl插件，因为我习惯在1个Tab下用多个buffer"
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_nr_show = 1

" 背景透明
hi Normal ctermbg=NONE
" hi LineNr ctermbg=NONE ctermfg=grey
hi CursorLineNr cterm=NONE ctermbg=234 ctermfg=72
hi Cursorline cterm=NONE ctermbg=234
se t_Co=256
nmap <a-t> :sp<cr>:term<cr>i
"inoremap <esc> <nop>
imap jk <ESC>
noremap <F2> :vsp ~/.config/nvim/init.vim <cr> 
noremap <leader>s :source ~/.config/nvim/init.vim <cr>
noremap <leader>w :w <cr>
noremap <leader>r :e!
nmap <leader>wwh <c-w>5<
nmap <leader>wwl <c-w>5>
nmap <leader>wwj <c-w>5-
nmap <leader>wwk <c-w>5+
nmap <leader>q :qa<cr>
nmap <leader>Q :qa!<cr>
nmap <leader>h <c-w>h
nmap <leader>j <c-w>j
nmap <leader>k <c-w>k
nmap <leader>l <c-w>l
nmap <leader>G gg"+yG
nmap tt :NERDTreeToggle<cr>
vmap <cr> <esc>
nmap ss <Plug>(easymotion-s2)
nmap <leader>wo <c-w>o
nmap <leader>' ciw""<esc>hp

autocmd Filetype markdown inoremap ,f <esc>/<++><CR>:nohlsearch<CR>c4l
autocmd Filetype markdown inoremap ,n ---<Enter><Enter>
autocmd Filetype markdown inoremap ,b  **** <++><esc>F*hi
autocmd Filetype markdown inoremap ,s ~~~~ <++><esc>F~hi
autocmd Filetype markdown inoremap ,i ** <++><esc>F*i
autocmd Filetype markdown inoremap ,d `` <++><esc>F`i
autocmd Filetype markdown inoremap ,c ```<Enter><++><Enter>```<Enter><Enter><++><esc>4kA
autocmd Filetype markdown inoremap ,h ====<Space><++><esc>F=hi
autocmd Filetype markdown inoremap ,p ![](<++>) <++><esc>F[a
autocmd Filetype markdown inoremap ,a [](<++>) <++><esc>F[a
autocmd Filetype markdown inoremap ,1 #<Space><Enter><++><esc>kA
autocmd Filetype markdown inoremap ,2 ##<Space><Enter><++><esc>kA
autocmd Filetype markdown inoremap ,3 ###<Space><Enter><++><esc>kA
autocmd Filetype markdown inoremap ,4 ####<Space><Enter><++><esc>kA
autocmd Filetype markdown inoremap ,l --------<Enter>
autocmd Filetype markdown imap ,t <esc>:TableFormat<cr>a
